import { defineStore } from "pinia";

const useHuazhongStore = defineStore("huazhong", {
  state: () => ({
    approve: {},
    sysHzCommissionDistributionList: [],
  }),
  persist: {
    enabled: true,
    strategies: [
      {
        key: "approveFlow",
        storage: localStorage,
        paths: ["approve"],
      },
      {
        key: "sysHzCommissionDistributionList",
        storage: localStorage,
        paths: ["sysHzCommissionDistributionList"],
      },
    ],
  },
  actions: {
    setApprove(data) {
      this.approve = data;
    },
    setSysHzCommissionDistributionList(data) {
      this.sysHzCommissionDistributionList = data;
    },
  },
});

export default useHuazhongStore;
